Re-exports
Modules
Durable Objects provide low-latency coordination and consistent storage for the Workers platform. A given namespace can support essentially unlimited Durable Objects, with each Object having access to a transactional, key-value storage API.
Macros
When debugging your Worker via wrangler dev
, wrangler tail
, or from the Workers Dashboard,
anything passed to this macro will be printed to the terminal or written to the console.
When debugging your Worker via wrangler dev
, wrangler tail
, or from the Workers Dashboard,
anything passed to this macro will be printed to the terminal or written to the console.
When debugging your Worker via wrangler dev
, wrangler tail
, or from the Workers Dashboard,
anything passed to this macro will be printed to the terminal or written to the console.
When debugging your Worker via wrangler dev
, wrangler tail
, or from the Workers Dashboard,
anything passed to this macro will be printed to the terminal or written to the console.
Structs
An interface that allows you to abort in-flight Fetch requests.
An interface representing a signal that can be passed to cancellable operations, primarily a Fetch request.
Provides access to the Cache API.
Because match
is a reserved keyword in Rust, the match
method has been renamed to get
.
In addition to the methods on the Request
struct, the Cf
struct on an inbound Request contains information about the request provided by Cloudflare’s edge.
Wrapper/Utility struct for the web_sys::CloseEvent
A context bound to a fetch
event.
Cors struct, holding cors configuration
The equivalent to a JavaScript Date
Object.
A binding for dispatching events to Workers inside of a dispatch namespace by their name. This allows for your worker to directly invoke many workers by name instead of having multiple service worker bindings.
Env contains any bindings you have associated with the Worker when you uploaded it.
A Stream
that yields WebsocketEvent
s
emitted by the inner WebSocket
. The stream is guranteed to always yield a
WebsocketEvent::Close
as the final non-none item.
A struct for invoking fetch events to other Workers.
A FormData representation of the request body, providing access to form encoded fields and files.
Wrapper/Utility struct for the web_sys::MessageEvent
Configuration options for Cloudflare’s minification features: https://www.cloudflare.com/website-optimization/
Optional options struct that contains settings to apply to the Request
.
Container for a route’s parsed parameters, data, and environment bindings from the Runtime (such as KV Stores, Durable Objects, Variables, and Secrets).
Represents the URL parameters parsed from the path, e.g. a route with “/user/:id” pattern would contain a single “id” key.
A path-based HTTP router supporting exact-match or wildcard placeholders and shared data.
A parsed URL record.
Wrapper struct for underlying worker-sys WebSocket
Struct holding the values for a JavaScript WebSocketPair
Enums
Successful outcomes when attempting to delete a Response
from the cache
Initialize a Date
by constructing this enum.
All possible Error variants that might be encountered while working with a Worker.
Construct a Fetch call from a URL string or a Request object. Call its send
method to execute
the request.
Representing the options any FormData value can be, a field or a file.
Configuration options for Cloudflare’s image optimization feature: https://blog.cloudflare.com/introducing-polish-automatic-image-optimizati/
Events that can be yielded by a EventStream
.
Type Definitions
A string value representing a binding to a secret in a Worker.
A string value representing a binding to an environment variable in a Worker.